version: "3.2"

services:
#HaProxy Container
  k3s_ha_proxy:
    image: haproxy:latest
    container_name: k3s-proxy
    hostname: k3s-proxy
    ports:
     - 6443:6443
     - 80:80
     - 8405:8405
     - 443:443
    volumes:
      - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
    restart: always
#    network_mode: host
#    cap_add:
#      - NET_ADMIN
#      - NET_RAW

  keepalived:
    image: osixia/keepalived:latest
    container_name: k3s-keepalived
    volumes:
      - ./keepalived.conf:/usr/local/etc/keepalived/keepalived.conf:ro
    restart: always
    network_mode: host
    cap_add:
      - NET_ADMIN
    environment:
      - KEEPALIVED_INTERFACE=ens160